<?php
if (!defined('IN_XLP')) {
    exit('Access Denied');
}
$Document = array(
    'pageid' => 'feedback-index', //页面标示
    'pagename' => '用户反馈', //当前页面名称
    'mycss' => array(), //加载的css样式表
    'myjs' => array(), //加载的js脚本
	'footerjs'=>array('content/jquery.smoothConfirm'),
    'head' => true, //加载头部文件
);
include getTpl('header', 'public');
?>
<!--顶部导航 开始-->
<?php include getTpl('top', 'public');?>
<!--顶部导航 结束-->
<!--左侧菜单 开始-->
<?php include getTpl('nav', 'public');?>
<!--左侧菜单 结束-->
<!--主体 开始-->
<!-- content -->
<section id="content"> 
  <!-- main padder -->
  <section class="main padder">
    <div class="clearfix">
      <h4><i class="fa fa-table"></i><?php echo trim($Document['pagename'],'_');?></h4>
    </div>
    <div class="row">
      <!-- table 11 -->
      <div class="col-lg-12">
        <section class="panel">
          <!---->
          <div class="panel-body">
            <div class="row text-small">
              <div class="col-sm-8">
                  <div class="btn-group">
                     <a class="btn btn-default" href="<?php echo U('feedback/index',array('all'=>1));?>">全部</a>
                     <a class="btn btn-default" href="<?php echo U('feedback/index',array('status'=>1));?>">未处理</a>
                     <a class="btn btn-default" href="<?php echo U('feedback/index',array('status'=>2));?>">有效</a>
                     <a class="btn btn-default" href="<?php echo U('feedback/index',array('status'=>3));?>">无效</a>
                  </div>
                  <div class="btn-group">
                     <a class="btn btn-default" href="<?php echo U('feedback/index',array('all'=>1));?>">全部</a>
                     <?php if($topicScreen){foreach($topicScreen as $k=>$v){?>
                     <a class="btn btn-default" href="<?php echo U('feedback/index',array('fmod'=>($k+1)));?>"><?php echo $v;?></a>
                     <?php }}?>
                  </div>
              </div>
              <div class="col-sm-4">
              </div>
            </div>
          </div>
          <!---->
          <div class="table-responsive">
            <table class="table table-striped b-t text-small">
              <thead>
                <tr>
                  <th align="center">ID</th>
                  <th align="center">用户</th>
                  <th align="center">类型</th>
                  <th align="center">标题</th>
                  <th align="center">反馈内容</th>
                  <th align="center">图片数</th>
                  <th align="center">处理人员</th>
                  <th align="center">处理时间</th>
                  <th align="center">处理状态</th>
                  <th align="center">反馈时间</th>
                  <th align="center" width="110">操作</th>
                </tr>
              </thead>
              <tbody>
                <?php
                    if ($rs){
                       foreach($rs as $val){
                 ?>
                <tr id="list_detail_<?php echo $val['id'];?>">
                  <td><?php echo $val['id'];?></td>
                  <td><a href="<?php echo U('feedback/index',array('uid'=>$val['uid']));?>"><?php echo $val['user_name'];?></a></td>
                  <td><a href="<?php echo U('feedback/index',array('fmod'=>$val['stype']+1));?>"><?php echo $val['mod_name'];?></a></td>
                  <td><a href="<?php echo U('feedback/detail',array('id'=>$val['id']));?>" rel="pop"><?php echo $val['title']?$val['title']:'我要反馈';?></a></td>
                  <td><?php echo cnsubStr($val['content']);?> 【<a href="<?php echo U('feedback/detail',array('id'=>$val['id']));?>" rel="pop">详细>></a>】</td>
				  <td><?php echo $val['photo_counts'];?></td>
                  <td><?php echo $val['admin_id']?$val['admin_name']:'';?></td>
                  <td><?php echo outTime($val['retime']);?></td>
                  <td id="set_status_id_<?php echo $val['id'];?>"><?php echo $status[$val['status']];?></td>
                  <td><?php echo $val['infotime']?outTime($val['infotime']):'';?></td>
                  <td><div class="btn-group">
                      <button class="btn btn-white btn-xs dropdown-toggle" data-toggle="dropdown">操作<span class="caret"></span></button>
                      <ul class="dropdown-menu">
                        <li><a href="javascript:;" rel="<?php echo $val['id'];?>" class="set-status">处理</a></li>
                        <li class="divider"></li>
                        <li><a href="<?php echo U('member/detail',array('uid'=>$val['uid'],'all'=>1));?>" rel="pop">用户信息</a></li>
                        <li><a href="<?php echo U('service/msg',array('uid'=>$val['uid']));?>" rel="pop">发送消息</a></li>
                        <li class="divider"></li>
                        <li><a href="javascript:;" rel="<?php echo $val['id'];?>" class="delete">删除</a></li>
                      </ul>
                    </div></td>
                </tr>
                <?php
                    }
                 }else{
              ?>
                <tr>
                  <td colspan="20" align="center">暂无数据</td>
                </tr>
                <?php
                  }
                ?>
              </tbody>
            </table>
          </div>
          <footer class="panel-footer">
            <div class="row">
              <div class="col-sm-12 text-right text-center-sm"> <?php echo page($total,$p,'',20,'p');?> </div>
            </div>
          </footer>
        </section>
      </div>
      <!--/ table 11 -->
    </div>
  </section>
  <!--/ main padder --> 
</section>
<!--/ content --> 
<!--主体 结束--> 
<script>
$(function(){
	$('.set-status').click(function(){
		var id=$(this).attr('rel');
	  $(this).smoothConfirm("请选择操作类型", {
		  okVal:'已处理',
		  cancelVal:'无效',
		  ok: function() {
			  Msg.loading();
			  $.post('<?php echo U('feedback/setting');?>',{"id":id,"status":1},function(result){
				  Msg.hide();
				  $("#set_status_id_"+id).html('<?php echo $status[1];?>');
			  },'json');
		  },
		  cancel: function() {
			  $.post('<?php echo U('feedback/setting');?>',{"id":id,"status":2},function(result){
				  $("#set_status_id_"+id).html('<?php echo $status[0];?>');
			  },'json');
		  }
	  });
	  $("body").click();//取消弹出层对对话框的遮蔽
	  return false;
	})
	$('.delete').click(function(){
		var id=$(this).attr('rel');
	  $(this).smoothConfirm("确认删除吗？", {
		  ok: function() {
			  $.post('<?php echo U('feedback/delete');?>',{"id":id},function(result){
				  $("#list_detail_"+id).fadeOut();
			  },'json');
		  },
		  cancel: function() {
			  return false;
		  }
	  });
	  $("body").click();//取消弹出层对对话框的遮蔽
	  return false;
	})	
})
</script>
<?php
include getTpl('footer', 'public');
?>
